package com.service.impl;

import com.entity.Student;
import com.mapper.StudentMapper;
import com.service.StudentService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Data
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Student> selectAllStudents() {
        return studentMapper.selectAllStudents();
    }

    @Override
    public Student selectOneStudentById(int id) {
        return studentMapper.selectOneStudentById(id);
    }

    @Override
    public List<Student> selectOneStudentByName(String studentName) {
        return studentMapper.selectOneStudentByName(studentName);
    }

    @Override
    public int deleteOneStudent(int id) {
        return studentMapper.deleteOneStudent(id);
    }

    @Override
    public int updateOneStudent(Student student) {
        return studentMapper.updateOneStudent(student);
    }

    @Override
    public int insertOneStudent(Student student) {
        return studentMapper.insertOneStudent(student);
    }
}
